﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
using System.ComponentModel;
namespace CoreData
{
    public class Student_History
    {
            public long ID{get;set;}
            public long StudentID{get;set;}
            [Description("Nội dung thay đổi")]
            public string Content{get;set;}
            public bool IsDeleted{get;set;}
         
        public Student_History()
        {       
                            Content ="";
                            IsDeleted = false;
        }
        
       static Student_History DynamicCast<T>(object row_data, object row_header) where T : Student_History
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Student_History ret = new Student_History();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "StudentID":
                        ret.StudentID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "Content":
                        ret.Content = ConvertObject.ToString(dt[column]);
                       break;
                      case  "IsDeleted":
                        ret.IsDeleted = ConvertObject.ToBool(dt[column]);
                       break;
                
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
